package 抽象数据类型;

/**
 * @description:  有向边
 * @author: ywk
 * @date: 2021-08-14
 */
public class DirectedEdge extends Edge {

    public DirectedEdge(int v, int w, double weight) {
        super(v, w, weight);
    }
    public double weight() {
        return super.weight();
    }
    public int from() {
        return super.v;
    }
    public int to() {
        return this.w;
    }

    @Override
    public String toString() {
        return String.format("%d->%d %.2f", v, w, weight);
    }
}
